package com.tz.platform.common;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;

import org.springframework.util.ReflectionUtils;

/**
 * 系统参数
 * @author Administrator
 *
 */
public class Constants {

	//平台编号
	public class SysCode{
		public static final String ALL = "ALL";
	}
		
	/**
	 * 初始密码
	 */
	public static final String DEFAULT_PASSWORD = "123456a";
	public static final String PASSWORD_MESSAGE_HIGHT = "密码要求：必须同时包含字母、数字、特殊字符(6-16位)!";
	public static final String PASSWORD_MESSAGE_MID   = "密码要求：必须由数字和字母组成(6-16位)!";
	public static final String PASSWORD_MESSAGE_LOW   = "密码要求:只能包含数字或字母(6-16位)!";
	public static final String PASSWORD_MESSAGE_ERROR = "原用户名或密码不正确!";
	
	//session用户信息
	public static final String SEESION_USER = "userInfo";
	
	
	
	
	
	@SuppressWarnings("rawtypes")
	public static List<String> getSysCodeValues() {
		List<String> list = new ArrayList<String>();
		try {
			Class clazz = Class.forName(Constants.SysCode.class.getName());
			Field[] fields = clazz.getDeclaredFields();
			for (Field f : fields) {
				if (!f.getName().contains("this")) {
					list.add((String)ReflectionUtils.getField(f, clazz));
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return list;
	}
	
}
